<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>register</title>
<link rel="stylesheet" media="screen"
	href="<%=basePath%>comresource/css/css.css" />
<link rel="stylesheet" media="screen"
	href="<%=basePath%>comresource/css/com.css" />

<script src="<%=basePath%>comresource/js/jquery-1.9.1.min.js"
	type="text/javascript"></script>
<script src="<%=basePath%>comresource/js/jquery.easing.min.js"
	type="text/javascript"></script>


<script src="<%=basePath%>/comresource/js/jquery.validate.min.js"
	type="text/javascript"></script>
<script type="text/javascript">

 $(function() {
    $( "#dialog" ).dialog();
  });
</script>
</head>
<form name="msform" id="msform" method="post">
	<!--  action="register"  -->
	<!-- progressbar -->
	<ul id="progressbar">
		<li class="active">Account Setup</li>
		<li>Social Profiles</li>
		<li>Personal Details</li>
		<div id="dialog" title="基本的对话框">
  <p>这是一个默认的对话框，用于显示信息。对话框窗口可以移动，调整尺寸，默认可通过 'x' 图标关闭。</p>
</div>
	</ul>
	<!-- fieldsets -->
	<fieldset>
		<h2 class="fs-title">Create your account</h2>
		<h3 class="fs-subtitle">This is step 1</h3>
		<input type="text" name="email" placeholder="Email" /> <input
			type="password" name="pass" placeholder="Password" /> <input
			type="password" name="cpass" placeholder="Confirm Password" /> <input
			type="button" name="next" class="next action-button" value="Next" />
	</fieldset>
	<fieldset>
		<h2 class="fs-title">Social Profiles</h2>
		<h3 class="fs-subtitle">Your presence on the social network</h3>
		<input type="text" name="qqnumber" placeholder="QQnubmer" /> <input
			type="text" name="sinaweibo" placeholder="SinaWeibo" /> <input
			type="text" name="blogs" placeholder="blogs" /> <input type="button"
			name="previous" class="previous action-button" value="Previous" /> <input
			type="button" name="next" class="next action-button" value="Next" />
	</fieldset>
	<fieldset>
		<h2 class="fs-title">Personal Details</h2>
		<h3 class="fs-subtitle">We will never sell it</h3>
		<input type="text" name="fname" placeholder="First Name" /> <input
			type="text" name="lname" placeholder="Last Name" /> <input
			type="text" name="phone" placeholder="Phone" />
		<textarea name="address" placeholder="Address"></textarea>
		<input type="button" name="previous" class="previous action-button"
			value="Previous" /> <input type="submit" id="action-button"
			name="submit" class="submit action-button" value="Submit"
			onclick=btnClick(); />
	</fieldset>
</form>
<script src="<%=basePath%>comresource/js/jQuery.time.js"
	type="text/javascript"></script>
<script type="text/javascript">

	function btnClick() {
		$("#msform").submit(function() {
			$.ajax({
				type : "POST",
				url : "register",
				data : $("#msform").serialize(),
				async : false,
				success : function(data) {
					tz(data);
				},
				error : function() {
					alert("信息错误")
				}
			})
			return false;
		})
		function tz(data) {
			document.location.href = "<%=basePath%>"+"web/icebreaker/login.jsp?email="+data.email+"";
		}
	}
</script>
<!-- <script type="text/javascript">
	$(document).ready(function() {
		$("#msform").validate({
			rules : {
				address : {
					required : true
				}
			},
			messages : {
				address : {
					required : "wrong"
				}
			}

		})
	})
</script> -->
</body>
</html>